package com.gzx.risk.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum AuthStatus {
    NOT_SUBMIT(0, "未提交"),

    /**
     * 已提交
     */
    SUBMIT(1, "已提交"),

    /**
     * 授权成功
     */
    AUTH_SUCCESS(2, "授权成功"),

    /**
     * 授权失败
     */
    AUTH_FAILED(3, "授权失败");

    private final Integer code;

    private final String desc;

    public static AuthStatus getByCode(int code) {
        for (AuthStatus status : values()) {
            if (status.code == code) {
                return status;
            }
        }
        return null;
    }
}
